/*
 * Alberto De Pena
 * Applied algorithms
 * pills.cpp
 */

#include <fstream>
#include <queue>
using namespace std;

void main()
{
	ifstream fin( "pills.in" );
	ofstream fout( "pills.out" );

	int m, n;
	char pill;
	queue<char> pills;

	fin >> m >> n;
	while( m != 0 && n != 0 )
	{
		bool firstdead = false;
		for( int i = 0; i < m; i++ )
		{
			fin >> pill;
			pills.push( pill );
		}

		for( int i = 1; i <= n; i++ )
		{
			pill = pills.front();
			pills.pop();
			pills.push( pill );

			pill = pills.front();
			pills.pop();
			if( pill == 'B' )
			{
				if( firstdead )
					fout << " " << i;
				else
				{
					firstdead = true;
					fout << i;
				}
			}
		}

		if( !firstdead )
			fout << "0";

		fout << endl;
		while( !pills.empty() )
			pills.pop();

		fin >> m >> n;
	}

	fin.close();
	fout.close();
}